package com.shop.cereshop.app.dao.after;

import com.shop.cereshop.app.dl.logic.vo.Refund;
import com.shop.cereshop.app.page.after.AfterDetail;
import com.shop.cereshop.app.page.after.AfterHistory;
import com.shop.cereshop.app.page.after.Afters;
import com.shop.cereshop.commons.domain.after.CereOrderAfter;
import com.shop.cereshop.commons.domain.order.CereOrderProduct;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface CereOrderAfterDAO {
    int deleteByPrimaryKey(Long afterId);

    int insert(CereOrderAfter record);

    int insertSelective(CereOrderAfter record);

    CereOrderAfter selectByPrimaryKey(Long afterId);

    int updateByPrimaryKeySelective(CereOrderAfter record);

    int updateByPrimaryKey(CereOrderAfter record);

    List<Afters> getAll(@Param("state") Integer state, @Param("buyerUserId") Long buyerUserId);

    AfterDetail getById(@Param("afterId") Long afterId);

    List<AfterHistory> findHistories(@Param("afterId") Long afterId);

    CereOrderAfter checkState(@Param("afterId") Long afterId, @Param("state") Integer state, @Param("afterType") Integer afterType);

    CereOrderAfter checkStateStayAndNo(@Param("afterId") Long afterId);

    CereOrderAfter checkStateStayAndNoAndType(@Param("afterId") Long afterId);

    Integer getByOrderId(@Param("orderId") Long orderId, @Param("skuId")Long skuId);

    void updateByOrderIdSkuId(@Param("orderId")Long orderId, @Param("skuId")Long skuId);


    CereOrderProduct getByOrderIdSkuId(@Param("orderId")Long orderId, @Param("skuId")Long skuId);

    CereOrderAfter selectByOrderId(@Param("orderId") Long orderId);

    Refund findOrderPay(@Param("afterId") Long afterId);
}